package com.chinasoft.sql;


import org.apache.ibatis.jdbc.SQL;

public class ReturnSql {
    public String getSelectAll(){
        String sql = new SQL(){
            {
                SELECT("*");
                FROM("student");
            }
        }.toString();
        return sql;
    }
    public String getInsert(){
        String sql = new SQL(){
            {
                INSERT_INTO("student");
                INTO_VALUES("#{id},#{name},#{age}");
            }
        }.toString();
        return sql;
    }
    public String getUpdate(){
        String sql = new SQL(){
            {
                UPDATE("student");
                SET("name=#{name}","age=#{age}");
                WHERE("id=#{id}");
            }
        }.toString();
        return sql;
    }

    public String getDelete(){
        String sql = new SQL(){
            {
                DELETE_FROM("student");
                WHERE("id=#{id}");
            }
        }.toString();
        return sql;
    }
}